﻿#region
/* ===============================================
 * 作者：guopeng           时间：2012/2/2 20:55:53
 * 
 * 
 * 类描述：
 * 
 * 
 * =============================================== */
#endregion

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.DataAnnotations;
using ueEngine.Biz.Inf.Entities.DBSupport;
using ueEngine.Framework.Exception;

namespace ueEngine.Biz.Inf.Entities
{
    /// <summary>
    /// 简历
    /// </summary>
    [Table("ResumeSheet")]
    public class ResumeSheet : BaseEntity<ResumeSheet>
    {
        public ResumeSheet() { }
        public override ResumeSheet Get(System.Linq.Expressions.Expression<Func<ResumeSheet, bool>> where)
        {
            using (Context ctx = new Context())
            {
                var item = ctx.ResumeSheet.FirstOrDefault(where);
                if (item != null)
                {
                    this.AboutMe = item.AboutMe;
                    this.Age = item.Age;
                    this.ContactPhone = item.ContactPhone;
                    this.Experience = item.Experience;
                    this.Gender = item.Gender;
                    this.Id = item.Id;
                    this.RealName = item.RealName;
                    this.Status = item.Status;
                    this.Title = item.Title;
                    this.UserName = item.UserName;
                    this.Address = item.Address;
                    this.Area = item.Area;
                    this.EMail = item.EMail;
                    this.Degree = item.Degree;
                    this.College = item.College;
                    return this;
                }
                return null;
            }
        }
        #region Fileds
        [Key]
        [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        [Column("Id", TypeName = "int")]
        public int Id { get; set; }

        /// <summary>
        /// 标题
        /// </summary>
        [Column("Title", TypeName = "nvarchar")]
        [StringLength(50)]
        public string Title { get; set; }
        /// <summary>
        /// 用户名
        /// </summary>
        [Column("UserName", TypeName = "varchar")]
        [StringLength(200)]
        public string UserName { get; set; }

        /// <summary>
        /// 联系姓名
        /// </summary>
        [Column("RealName", TypeName = "nvarchar")]
        [StringLength(200)]
        public string RealName { get; set; }

        /// <summary>
        /// 性别
        /// </summary>
        [Column("Gender", TypeName = "bit")]
        public bool Gender { get; set; }

        /// <summary>
        /// 年龄
        /// </summary>
        [Column("Age", TypeName = "int")]
        public int Age { get; set; }

        /// <summary>
        /// 目前身份
        /// 如：在校大学生 自由职业者 公司职员 
        /// </summary>
        [Column("Status", TypeName = "int")]
        public int Status { get; set; }

        /// <summary>
        /// 最高学历
        /// </summary>
        [Column(TypeName="int")]
        public int Degree { get; set; }
        /// <summary>
        /// 毕业于
        /// </summary>
        [Column(TypeName="nvarchar")]
        [StringLength(50)]
        public string College { get; set; }

        /// <summary>
        /// 兼职经历
        /// </summary>
        [Column("Experience",TypeName="nvarchar")]
        [StringLength(4000)]
        public string Experience { get; set; }
        /// <summary>
        /// 自我简介
        /// </summary>
        [Column("AboutMe", TypeName = "nvarchar")]
        [StringLength(4000)]
        public string AboutMe { get; set; }

        /// <summary>
        /// 联系phone
        /// </summary>
        [Column("ContactPhone", TypeName = "nvarchar")]
        [StringLength(200)]
        public string ContactPhone { get; set; }

        /// <summary>
        /// 联系邮箱
        /// </summary>
        [Column(TypeName="nvarchar")]
        [StringLength(200)]
        public string EMail { get; set; }

        /// <summary>
        /// 居住区域
        /// </summary>
        [Column(TypeName = "int")]
        public int Area { get; set; }

        /// <summary>
        /// 居住地址
        /// </summary>
        [Column(TypeName="nvarchar")]
        [StringLength(200)]
        public string Address { get; set; }
        #endregion
    }
}
